package Test1230am;

public class Test18 {

    public static void main(String[] args) {
        // (18)找出数中最大元素的下标
        int[] arr = {5, 3, 7, 2, 6};
        int max = arr[0];
        for (int i = 1; i < arr.length; i++) {
            if (arr[i] > max) {
                max = i;
            }
        }
        System.out.println(max);
    }
}
